From: Colin Walters Date: Tue, 25 Feb 2025 18:41:23 +0000 (-0500) Subject: tests/basic: Add lots of user. xattrs X-Git-Tag: archive/raspbian/2025.7-2+rpi1^2^2~6^2~5^2~8^2~1 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=0c55f6800625b1ea285a78929f78c59db54f121c;p=ostree.git tests/basic: Add lots of user. xattrs This exercises our requirement for xattr sorting. Signed-off-by: Colin Walters --- diff --git a/tests/basic-test.sh b/tests/basic-test.sh index c8f853f8..3f31c7ce 100644 --- a/tests/basic-test.sh +++ b/tests/basic-test.sh @@ -19,7 +19,7 @@ set -euo pipefail -echo "1..$((90 + ${extra_basic_tests:-0}))" +echo "1..$((91 + ${extra_basic_tests:-0}))" CHECKOUT_U_ARG="" CHECKOUT_H_ARGS="-H" @@ -443,6 +443,24 @@ if ! skip_one_without_user_xattrs; then echo "ok local clone checkout" fi +if test -z "${OSTREE_NO_XATTRS:-}"; then + cd ${test_tmpdir} + ${CMD_PREFIX} ostree --repo=repo checkout ${CHECKOUT_U_ARG} test2 test2-checkout + touch test2-checkout/testxattrs + # Intentionally heavily interspersed (not sorted) + for n in a z q e f n c r i a b x t k y; do + setfattr -n user.$n -v x test2-checkout/testxattrs + done + cat repo/config + $OSTREE commit ${COMMIT_ARGS} -b test2 --tree=dir=test2-checkout --consume + $OSTREE ls -X test2 /testxattrs > out.txt + assert_file_has_content_literal out.txt "(b'user.a', [0x78])" + assert_file_has_content_literal out.txt "(b'user.z', [0x78])" + echo "ok sorted xattrs" +else + echo "ok # SKIP no xattrs" +fi + $OSTREE checkout -U test2 checkout-user-test2 echo "ok user checkout"